#include "i2c.h"
#include "app_uart.h"
#include "board_support.h"
#include "nrf_delay.h"

volatile uint32_t g_ul_ms_ticks=0;
static volatile uint32_t TimingDelay=0;
unsigned long idle_time=0;

void board_init(void) 
{

    i2c_init();

//    uart_init(256000);
}


void mdelay(unsigned long nTime)
{
    nrf_delay_ms(nTime);
}

int get_tick_count(unsigned long *count)
{
    count[0] = g_ul_ms_ticks;
    return 0;
}

void TimingDelay_Decrement(void)
{
    if (TimingDelay != 0x00)
        TimingDelay--;
}

void TimeStamp_Increment(void)
{
    g_ul_ms_ticks++;
}

//void SysTick_Handler(void)
//{
//    TimingDelay_Decrement();
//    TimeStamp_Increment();
//}

